package mumu.android.localstorage;

import mumu.android.R;
import mumu.android.lib.localstorage.NewsDAO;
import mumu.android.lib.localstorage.NewsEn;
import android.app.Dialog;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;

public class contentproviderdf extends DialogFragment {

	static contentproviderdf instance;

	public static contentproviderdf getInstance() {
		if (instance == null) {
			instance = new contentproviderdf();
		}
		return instance;
	}

	Dialog dialog;

	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState) {
		if (dialog == null) {
			dialog = new Dialog(getActivity(), R.style.dialog);
			LayoutInflater layoutInflater = LayoutInflater.from(getActivity());
			View view = layoutInflater.inflate(R.layout.dialog_listview, null);
			view.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
			dialog.setContentView(R.layout.dialog_listview);
			dialog.setCanceledOnTouchOutside(true);
		}
		NewsEn newsEn = new NewsEn();
		newsEn.newsid = 1;
		newsEn.defaultlogo = "aa";
		newsEn.newstitle = "叙利亚";
		NewsDAO.Instance(getActivity()).add(newsEn);
		NewsEn newsEns = NewsDAO.getModelProvider(getActivity());
		return dialog;
	}
}
